import Mock from "mockjs"
//import productList from "./goodsList.json"

//自己生成模拟数据
let productList = [];
for (let i = 1; i <= 160; i++) {
	productList.push({
		id: i, //编号
		name: "商品名" + i + Mock.Random.ctitle(10, 30), //标题10-30字符
		img: Mock.Random.dataImage('100x100', '商品' + i), //商品图片
		spec: "商品规格" + i + Mock.Random.ctitle(20, 40), //规格内容
		count: Mock.Random.integer(200, 999), //数量
		price: Mock.Random.integer(4000, 9999), //价格
	});
}

Mock.mock(new RegExp('/product/page'), 'get', options => {
	console.log(options) //仅仅是为了测试，看看这个值。
	return {
		code: 1,
		data: productList,
	}
})